package tag31_22_08.list;

import java.util.ArrayList;
import java.util.List;

public class List02_contains {

	public static void main(String[] args) {

		List<String> listStr = new ArrayList<String>();
		
//		ArrayList<List> al = new ArrayList<List>(); 		// OK.
//		List<ArrayList> li = new ArrayList<ArrayList>(); 	//OK.
		
		boolean erg = listStr.contains("Hello");
		
		String s1 = new String("Mo");
		String s2 = new String("Mo");
		String s3 = "Mo";
		String s4 = "Mo";
		
		System.out.println( s1 == s2 ); // false
		System.out.println( s3 == s4 ); // true

		listStr.add(s1);
		listStr.add(s2);
		listStr.add(s3);
		listStr.add(s4);
		
		System.out.println("size: " + listStr.size());
		
		boolean gefunden = listStr.contains("Mo"); //Vergleich mit equals der Klasse String
		System.out.println("gefunden = " + gefunden);
		
		gefunden = listStr.contains( new String("Mo") );
		System.out.println("gefunden = " + gefunden);
		
	} //end of main

}
